package com.umgsai.thread.thread08;

public class ObjectService {
	public void serviceMethodA() {
		try {
			synchronized (this) {
				System.out.println("serviceMethodA begin time=" + System.currentTimeMillis());
				Thread.sleep(2000);
				System.out.println("serviceMethodA end time=" + System.currentTimeMillis());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void serviceMethodB() {
		synchronized (this) {
			System.out.println("serviceMethodB begin time=" + System.currentTimeMillis());
			System.out.println("serviceMethodB end time=" + System.currentTimeMillis());
		}
	}
}
